package system.controller;

import common.model.response.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import common.model.request.RegisterRequest;
import system.service.SysUserService;

import javax.annotation.Resource;

/**
 * 新用户注册
 *
 * @author 米泽鹏
 * @since 2022-3-23 下午 6:47
 */
@Api(tags = "新用户注册")
@RestController
@RequestMapping("/system/register")
public class RegisterController {

	@Resource
	private SysUserService userService;

	@ApiOperation(value = "新用户注册", notes = "新用户注册")
	@PostMapping("/doRegister")
	public Result<?> register(@ApiParam(value = "新用户注册请求", required = true) @RequestBody @Validated RegisterRequest request) {
		return userService.register(request);
	}

}
